package com.tubi.生产消费;

public class Desk {
//    标记
//    如果是true 标识有汉堡包 吃货执行
//    false 厨师执行
   // public  static  boolean flag = false;

    private  boolean flag;
//    汉堡总数量
 //   public  static  int cunt = 10;
    private  int cunt;

//    锁对象 final 唯一
  //  public  static  final Object lock  = new Object();

    private  final  Object lock = new Object();

    public Desk(boolean flag, int cunt) {
        this.flag = flag;
        this.cunt = cunt;
    }

    public Desk() {
        this(false,10);
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public int getCunt() {
        return cunt;
    }

    public void setCunt(int cunt) {
        this.cunt = cunt;
    }

    public Object getLock() {
        return lock;
    }

    @Override
    public String toString() {
        return "Desk{" +
                "flag=" + flag +
                ", cunt=" + cunt +
                ", lock=" + lock +
                '}';
    }
}
